-
Notifications
You must be signed in to change notification settings - Fork 20
feat: decouple aggsender-validator from metadata field
#846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: decouple aggsender-validator from metadata field
#846
Conversation
5f358c3 to
e6c5900
Compare
bd03b14 to
b70e1f0
Compare
Stefan-Ethernal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't we yet ready to remove the certificate metadata (
aggkit/aggsender/types/certificate_metadata.go
Lines 19 to 38 in 416c39c
| type CertificateMetadata struct { | |
| // ToBlock contains the pre v1 value stored in the metadata certificate field | |
| // is not stored in the hash post v1 | |
| ToBlock uint64 | |
| // FromBlock is the block number from which the certificate contains data | |
| FromBlock uint64 | |
| // Offset is the number of blocks from the FromBlock that the certificate contains | |
| Offset uint32 | |
| // CreatedAt is the timestamp when the certificate was created | |
| CreatedAt uint32 | |
| // Version is the version of the metadata | |
| Version uint8 | |
| // CertType is the type of certificate | |
| CertType uint8 // version >= V2 | |
| } |
@Stefan-Ethernal That will be done in a subsequent PR. I wanted to make these PRs as small and concise as possible, so that they are more easier to review. |
2764d7b to
8eb3021
Compare
8eb3021 to
6d029e0
Compare
|
## 🔄 Changes Summary This PR completely removes the logic around setting `Metadata` field on certificates since it will no longer be used to determin block ranges on `aggsender`. `Metadata` field will still exist on certificates, but it will no longer be used, and a `ZeroHash` will be enforced instead. ##⚠️ Breaking Changes NA ## 📋 Config Updates NA ## ✅ Testing - 🤖 **Automatic**: `aggkit` CI ## 🐞 Issues #799 ## 🔗 Related PRs #838 #839 #846
## 🔄 Changes Summary Enable the AggSender to work with multiple validator nodes in a committee-based validation system. The implementation includes validator services, multisig committee management, certificate validation improvements, and enhanced gRPC communication protocols. **Multisig Committee Support:** - Added `MultisigCommittee` type to manage signer sets and enforce signature thresholds. - Signers are represented as `SignerInfo` structs with both address and URL for improved context and error reporting. - Committee construction validates non-empty membership and non-zero threshold, preventing misconfiguration. - Dynamic signer management: methods for adding signers, duplicate checks by address and URL. **Aggsender Validator Refactor:** - The Aggsender certificate validation flow was refactored to integrate multisig logic. - The multisig validation logic is applicable to both `PP` and `FEP` certificates. - Certificate validation now checks for contiguous certificates, last L2 block, and settlement status using new queries. - Import bridge exit proof verification is handled via new logic using `verifyClaimProofs`, ensuring only valid proofs pass. **Certificate Metadata removal:** - It is gone from the agglayer and therefore it is not sent anymore from the aggsender either. - Only thing worth noting is that, when calculating `CertificateID`, instead of metadata field, which was used previously, we now use `ZeroHash`. **Smart contracts integration:** - **AggchainFEP contract:** Removed querying of `TrustedSequencer` address and rely on the signers committee instead - **AggchainBase contract:** Retrieve the multisig committee from the `AggchainBase` contract **Agglayer integration:** - Invoke the `GetNetworkState` API from agglayer to get the latest settled imported bridge exit info. - Multisig is populated into the certificate and sent to the Agglayer's `SendCertificate` gRPC endpoint ##⚠️ Breaking Changes - 🛠️ **Config**: Make sure that `Mode` on the `Validator` and `AggSender` are the same. - 🔌 **API/CLI**: `aggkit` version (`v0.7.0`) that supports `multisig` will now require updated contracts to run. At least version `v12.1.0-rc.3` of `agglayer-contracts`, and a new version of `agglayer` which supports `multisig`, which is the `v0.4.0` of `agglayer`. - 🗑️ **Deprecated Features**: Aggsender Phase II validator signing logic ## 📋 Config Updates - Added `AggSender.RequireCommitteeMembershipCheck = false` parameter, which defines if a check on `aggsender proposer` startup will be performed to see if the proposer is in the `multisig` committee. - Added `Validator.RequireCommitteeMembershipCheck = {{AggSender.RequireCommitteeMembershipCheck}}` parameter, which defines if a check on `aggsender validator` startup will be performed to see if the validator is in the `multisig` committee. - Added `Validator.Mode = "PessimisticProof"` parameter, which acts the same as the `AggSender.Mode`. It tells the validator that the network is a `PP` network or an `FEP` network. It has to be the same as on `aggsender proposer`. - Added `Validator.FEPConfig.SovereignRollupAddr = "{{AggSender.SovereignRollupAddr}}" parameter which is the address of the `AggchainFEP` rollup on L1 for given network for which validator is running. - Added `Validator.FEPConfig.RequireNoBlockGap = {{AggSender.RequireNoFEPBlockGap}}, which acts the same as the given paremeter on `AggSender` (proposer) config, and tells the validator if gaps in blocks in certificates are allowed in `FEP` network. ```toml [AggSender] RequireCommitteeMembershipCheck = false [Validator] # PessimisticProof or AggchainProof Mode = "PessimisticProof" RequireCommitteeMembershipCheck = {{AggSender.RequireCommitteeMembershipCheck}} [Validator.FEPConfig] SovereignRollupAddr = "{{AggSender.SovereignRollupAddr}}" RequireNoBlockGap = "{{AggSender.RequireNoFEPBlockGap}}" ``` ## ✅ Testing - 🤖 **Automatic**: `aggkit` CI - 🖱️ **Manual**: [Optional: Steps to verify] ## 🐞 Issues - Closes #792 ## 🔗 Related PRs - #814 - #832 - #838 - #839 - #843 - #842 - #846 - #858 - #847 - #865 - #861 - #863 - #875 - #876 - #881 - #877 - #898 - #920 - #913 - #926 - #945 - #951 - #954 - #957 - #955 - #974 - #978 - #985 - #989 - #984 - #998 - #1017 - #1028 - #1034 - #1024 - #1052 - #1067 - #1068 - #1050 - #1071 - #1072 - #1060 - #1087 - #1077 - #1073 --------- Co-authored-by: Goran Rojovic <[email protected]> Co-authored-by: Goran Rojovic <[email protected]> Co-authored-by: Joan Esteban <[email protected]> Co-authored-by: Rachit Sonthalia <[email protected]> Co-authored-by: Arpit Temani <[email protected]> Co-authored-by: Copilot <[email protected]>



🔄 Changes Summary
This PR decouples
aggsender-validatorfrom using theMetadatafield in certificate to figure out block range.The validator will now use the
certificate querierinterface to get theToBlockfrom the last settled certificate in order to figure out if the new certificate is valid or not.NA
📋 Config Updates
NA
✅ Testing
aggkitCI🔗 Related PRs
metadata#838agglayerfrom ceritificatemetadata#839